package com.blacktea.behavioralpatterns.interpreterpattern;

import java.util.Map;

/**
 * @description: 解释器上下文环境
 * @author: black tea
 * @date: 2023/3/25 15:22
 */
public class Context {

    private final Map<String, Object> variables;

    public Context(Map<String, Object> variables) {
        this.variables = variables;
    }

    public Object getVariableValue(String variableName) {
        return variables.get(variableName);
    }

    public void putAll(Map<String, Object> metaData){
        variables.putAll(metaData);
    }
}
